<?php ob_start() ?>
<div class="row">
    <div class="col-lg-12">
        <h1>Inicio <small>Resumen</small></h1>
    </div>
</div>
<hr>
<div class="row">
    <div class="col-lg-3">
        <div class="panel panel-warning">
            <div class="panel-heading">
                <div class="row">
                    <div class="col-xs-6">
                        <i class="fa fa-spinner fa-spin fa-5x"></i>
                    </div>
                    <div class="col-xs-6 text-right">
                        <p class="announcement-heading"><?php echo $num_partidos ?></p>
                        <p class="announcement-text">Partidos pendientes</p>
                    </div>
                </div>
            </div>
            <a href="partidos">
                <div class="panel-footer announcement-bottom">
                    <div class="row">
                        <div class="col-xs-6">
                            Ver Partidos
                        </div>
                        <div class="col-xs-6 text-right">
                            <i class="fa fa-arrow-circle-right"></i>
                        </div>
                    </div>
                </div>
            </a>
        </div>
    </div>
    <div class="col-lg-3">
        <div class="panel panel-info">
            <div class="panel-heading">
                <div class="row">
                    <div class="col-xs-6">
                        <i class="fa fa-users fa-5x"></i>
                    </div>
                    <div class="col-xs-6 text-right">
                        <p class="announcement-heading"><?php echo $num_usuarios ?></p>
                        <p class="announcement-text">Usuarios Registrados</p>
                    </div>
                </div>
            </div>
            <a href="usuarios">
                <div class="panel-footer announcement-bottom">
                    <div class="row">
                        <div class="col-xs-6">
                            Ver Usuarios
                        </div>
                        <div class="col-xs-6 text-right">
                            <i class="fa fa-arrow-circle-right"></i>
                        </div>
                    </div>
                </div>
            </a>
        </div>
    </div>
    <div class="col-lg-3">
        <div class="panel panel-success">
            <div class="panel-heading">
                <div class="row">
                    <div class="col-xs-6">
                        <i class="fa fa-gavel fa-5x"></i>
                    </div>
                    <div class="col-xs-6 text-right">
                        <p class="announcement-heading"><?php echo $num_porras ?></p>
                        <p class="announcement-text">Porras disponibles</p>
                    </div>
                </div>
            </div>
            <a href="porras">
                <div class="panel-footer announcement-bottom">
                    <div class="row">
                        <div class="col-xs-6">
                            Ver Porras
                        </div>
                        <div class="col-xs-6 text-right">
                            <i class="fa fa-arrow-circle-right"></i>
                        </div>
                    </div>
                </div>
            </a>
        </div>
    </div>
    <div class="col-lg-3">
        <div class="panel panel-default">
            <div class="panel-heading">
                <div class="row">
                    <div class="col-xs-6">
                        <i class="fa fa-gift fa-5x"></i>
                    </div>
                    <div class="col-xs-6 text-right">
                        <p class="announcement-heading"><?php echo $num_premios ?></p>
                        <p class="announcement-text">Premios Canjeados</p>
                    </div>
                </div>
            </div>
            <a href="premios">
                <div class="panel-footer announcement-bottom">
                    <div class="row">
                        <div class="col-xs-6">
                            Ver Premios
                        </div>
                        <div class="col-xs-6 text-right">
                            <i class="fa fa-arrow-circle-right"></i>
                        </div>
                    </div>
                </div>
            </a>
        </div>
    </div>
    <div class="col-lg-4">
        <div class="panel panel-danger">
            <div class="panel-heading">
                <div class="row">
                    <div class="col-xs-6">
                        <i class="fa fa-money fa-5x"></i>
                    </div>
                    <div class="col-xs-6 text-right">
                        <p class="announcement-heading"><?php echo $bote_en_juego ?></p>
                        <p class="announcement-text">Bote en juego</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="col-lg-4">
        <div class="panel panel-warning">
            <div class="panel-heading">
                <div class="row">
                    <div class="col-xs-6">
                        <i class="fa fa-tasks fa-5x"></i>
                    </div>
                    <div class="col-xs-6 text-right">
                        <p class="announcement-heading"><?php echo $num_pronosticos ?></p>
                        <p class="announcement-text">Pronosticos</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="col-lg-4">
        <div class="panel panel-info">
            <div class="panel-heading">
                <div class="row">
                    <div class="col-xs-6">
                        <i class="fa fa-cog fa-spin fa-5x"></i>
                    </div>
                    <div class="col-xs-6 text-right">
                        <p class="announcement-heading"><?php echo $num_puntos ?></p>
                        <p class="announcement-text">Puntos repartidos</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title"><i class="fa fa-spinner"></i> Proximos partidos</h3>
            </div>
            <div class="panel-body">
                <div class="table-responsive">
                    <table class="table table-bordered table-hover table-striped tablesorter">
                        <thead>
                            <tr>
                                <th>Fecha <i class="fa fa-sort"></i></th>
                                <th>Local <i class="fa fa-sort"></i></th>
                                <th>Visitante <i class="fa fa-sort"></i></th>
                                <th>Goles Local <i class="fa fa-sort"></i></th>
                                <th>Goles Visitante <i class="fa fa-sort"></i></th>
                                <th>Estado <i class="fa fa-sort"></i></th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php foreach ($params_partidos as $fila) { ?>

                                <tr>
                                    <td><?php echo date("d-m-Y H:i", strtotime($fila['fecha'])); ?></td>
                                    <td><a href="ver_equipo/<?php echo $fila['equipo_local'] ?>"><img style="width: 2em;" src="/betporra/web/images/clubs/<?php echo $fila['equipolocalescudo'] ?>"/> <?php echo $fila['equipolocalnombre'] ?></a></td>
                                    <td><a href="ver_equipo/<?php echo $fila['equipo_visitante'] ?>"><img style="width: 2em;" src="/betporra/web/images/clubs/<?php echo $fila['equipovisitanteescudo'] ?>"/> <?php echo $fila['equipovisitantenombre'] ?></a></td>
                                    <td><?php echo $fila['goles_local'] ?></td>
                                    <td><?php echo $fila['goles_visitante'] ?></td>
                                    <td><?php echo $fila['estado'] ?></td>
                                </tr>

                            <?php } ?>
                        </tbody>
                    </table>
                </div>
                <div class="text-right">
                    <a href="partidos">Ver todos los partidos <i class="fa fa-arrow-circle-right"></i></a>
                </div>
            </div>
        </div>
    </div>

    <div class="col-lg-12">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title"><i class="fa fa-users"></i> Ultimos usuarios</h3>
            </div>
            <div class="panel-body">
                <div class="table-responsive">
                    <table class="table table-bordered table-hover table-striped tablesorter">
                        <thead>
                            <tr>
                                <th>Usuario <i class="fa fa-sort"></i></th>
                                <th>Nombre <i class="fa fa-sort"></i></th>
                                <th>Email <i class="fa fa-sort"></i></th>
                                <th>Fecha de Registro <i class="fa fa-sort"></i></th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php foreach ($params_usuarios as $fila) { ?>

                                <tr>
                                    <td><?php echo $fila['usuario'] ?></td>
                                    <td><?php echo $fila['nombre'] ?></td>
                                    <td><?php echo $fila['email'] ?></td>
                                    <td><?php echo date("d-m-Y H:i", strtotime($fila['fecha_registro'])); ?></td>
                                </tr>

                            <?php } ?>
                        </tbody>
                    </table>
                </div>
                <div class="text-right">
                    <a href="usuarios">Ver todos los usuarios <i class="fa fa-arrow-circle-right"></i></a>
                </div>
            </div>
        </div>
    </div>

</div>

<?php
$contenido = ob_get_clean();
include 'app/templates/template_admin.php';
?>